package net.huashitong.order.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.goodsclass.entity.GoodsClasses;
import net.huashitong.goodsclass.filter.GoodsClassFilter;
import net.huashitong.order.dao.OrderDao;
import net.huashitong.order.entity.Order;
import net.huashitong.order.filter.OrderFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderService extends StringPKService<Order> {
    @Autowired
    private OrderDao dao;
    @Autowired
    private SysTableService tableService;

    @Override
    protected BaseDao<Order, String> getDao() {
        return dao;
    }

    @Override
    protected void beforeSave(Order obj) {
        obj.setSysId(tableService.updateMaxSysId("t_goods_classes", null));
    }

    public List<Order> queryPageList(OrderFilter filter)
    {
        List<Order> query = dao.query(filter);
        return query;
    }
}
